<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
<h:head>
	<title>Examen</title>
</h:head>
<h:body>
	<h:form id="formExamen">

		<p:toolbar>
			<p:toolbarGroup align="right">
				<p:commandButton value="salir"
					actionListener="#{sesionBean.cerrarSesion()}" icon="ui-icon-close" />
			</p:toolbarGroup>
		</p:toolbar>

		<div align="center">
			<h:panelGrid columns="2" styleClass="fondo"
				style="text-align:center;">
				<h:panelGroup style="display:block; text-align:left">
					<p:graphicImage value="/img/ui/images.jpg"
						style="height: 100px; width: 210px" />
				</h:panelGroup>

				<h:panelGroup style="display:block; text-align:right">
					<p:graphicImage value="/img/ui/izq.png"
						style="height: 100px; width: 608px" />
				</h:panelGroup>
			</h:panelGrid>
		</div>

		<p:panel rendered="#{examenBean.verificarNoExamen()}"
			style="width:100%;">
			<h:outputLabel value="Ya rindió examen" />
		</p:panel>

		<p:panel id="panelExamen" style="width:100%;"
			rendered="#{examenBean.verificarExamen()}">
			<h:panelGrid columns="6" cellpadding="2" cellspacing="15">
				<h:outputLabel value="                EVALUACION EN CURSO"
					style="font-weight:bold" />
				<h:outputLabel value=" " />
				<h:outputText value="                HORA ACTUAL"
					style="font-weight:bold" />
				<p:clock pattern="HH:mm:ss dd.MM.yyyy" mode="server" />
				<h:outputLabel value="   FIN DE EXAMEN" style="font-weight:bold" />
				<p:outputLabel value="#{examenBean.evaluacion.horaFinEvaluacion}"
					style="font-weight:bold" />
			</h:panelGrid>
			<p:separator id="customSeparator" style="width:2000px;height:30px" />



			<h:panelGrid columns="2" cellpadding="2" cellspacing="15" id="NADA">

				<p:panel header="#{examenBean.indiceTexto}">
					<h:outputText value="#{examenBean.enunciado}" />
				</p:panel>

			</h:panelGrid>
			<h:outputLabel value="ALTERNATIVAS: " style="font-weight:bold" />

			<p:selectOneRadio id="customRadio" value="#{examenBean.numRespuesta}"
				layout="custom">
				<f:selectItem itemLabel="Alternativa 1: " itemValue="1" />
				<f:selectItem itemLabel="Alternativa 2: " itemValue="2" />
				<f:selectItem itemLabel="Alternativa 3: " itemValue="3" />
				<f:selectItem itemLabel="Alternativa 4: " itemValue="4" />
				<f:selectItem itemLabel="Alternativa 5: " itemValue="5" />
			</p:selectOneRadio>

			<h:panelGrid columns="3">
				<p:radioButton id="opt1" for="customRadio" itemIndex="0" />
				<p:outputLabel value="a)  " />
				<h:outputText value="#{examenBean.alt1}" />
				<p:radioButton id="opt2" for="customRadio" itemIndex="1" />
				<p:outputLabel value="b)  " />
				<h:outputText value="#{examenBean.alt2}" />
				<p:radioButton id="opt3" for="customRadio" itemIndex="2" />
				<p:outputLabel value="c)  " />
				<h:outputText value="#{examenBean.alt3}" />
				<p:radioButton id="opt4" for="customRadio" itemIndex="3" />
				<p:outputLabel value="d)  " />
				<h:outputText value="#{examenBean.alt4}" />
				<p:radioButton id="opt5" for="customRadio" itemIndex="4" />
				<p:outputLabel value="e)  " />
				<h:outputText value="#{examenBean.alt5}" />
			</h:panelGrid>

			<h:panelGrid columns="6" cellpadding="2">
				<h:outputLabel value="               " style="font-weight:bold" />
				<p:commandButton value="Anterior" update="panelExamen"
					actionListener="#{examenBean.atras}"
					disabled="#{examenBean.validarAtras()}" />
				<p:commandButton value="Siguiente" update="panelExamen"
					actionListener="#{examenBean.siguiente}"
					disabled="#{examenBean.validarSiguiente()}" />

				<p:commandButton value="Terminar Examen"
					actionListener="#{examenBean.terminarExamen()}"
					oncomplete="dlg.show()" update="growlx" />

				<p:dialog id="picture" widgetVar="dlg" header="Resultado"
					width="425" resizable="false" showEffect="clip" hideEffect="clip">
					<p:ajax event="close" listener="#{examenBean.handleClose}" />
					<p:outputLabel id="growlx" value="#{examenBean.resultado}" />
				</p:dialog>

			</h:panelGrid>



		</p:panel>

	</h:form>
</h:body>
</html>